﻿<?php

class TRelEmprestimo{
    
    private $conteudo;
    
    public function __construct(array $conteudo) 
    {
        $this->conteudo = $conteudo;       
    }
   
    public function render()
    {
        $html = '';
        foreach($this->conteudo as $item)
        {
            $tabela = new TTableEmprestimo($item);
            $html .= $tabela->render();
        }
        
        $pdf = new TRelatorio();
        $pdf->pdf->WriteHTML(utf8_encode($html));
        $pdf->pdf->Output('emprestimos '.date('d m Y').'.pdf','D');
    }
    
}
?>
